﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Editor.QuestionInterface
{
    public partial class AddHintQeustionForm : Form
    {
        public HelperQuestionUserControl HelperQuestion { get; set; }

        public AddHintQeustionForm()
        {
            InitializeComponent();
        }

        private void AddHintQeustionForm_Load(object sender, EventArgs e)
        {
            comboBoxQuestionType.SelectedIndex = 0;
        }

        private void buttonAdd_Click(object sender, EventArgs e)
        {
            switch (comboBoxQuestionType.SelectedIndex)
            {
                case 0:
                    HelperQuestion = new AlfanumBasedHelperQuestion();
                    break;
                case 1:
                    HelperQuestion = new ChoiceBasedHelperQuestion();
                    break;
            }

            HelperQuestion.BodyText = textBoxText.Text;
            HelperQuestion.Answer = textBoxAnswer.Text;
            HelperQuestion.CorrectAnswerDescription = textBoxCAns.Text;
            HelperQuestion.IncorrectAnswerDescription = textBoxIAns.Text;
            DialogResult = System.Windows.Forms.DialogResult.OK;
        }
    }
}
